package cc.dawning.utiming.lklocation.location.global;

import android.os.Handler;
import android.os.Message;

import cc.dawning.utiming.lklocation.location.api.LocationEventListener;


/**
 * Date 2018/3/28
 * Describe 地图定位handler
 *
 * @auther liuxin
 */

public class LocationHandler extends Handler {

    /**
     * 地图位置选择事件监听
     */
    private LocationEventListener listener;

    public LocationHandler(LocationEventListener listener) {
        this.listener = listener;
    }

    @Override
    public void handleMessage(Message msg) {
        super.handleMessage(msg);

        if (null == listener) {
            return;
        }
        switch (msg.what) {
            case LocationHandlerKey.REFRESH_DATA:
                listener.RefrushPOIData(msg);
                break;
            case LocationHandlerKey.LOAD_MORE_DATA:
                listener.LoadMorePOIData(msg);
                break;
            case LocationHandlerKey.LOAD_FILE:
                break;
            case LocationHandlerKey.SEARCH:
                listener.SearchListener(msg);
                break;
            default:
                break;
        }
    }
}
